<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    .box{
      width: 100px;
      height: 100px;
    }

    .box1{
      background-color: red;
      /* display: none; */ /* 不占位置 */
      visibility: hidden; /* 占位置 */
    }

    .box2{
      background-color: blue;
    }
    
  </style>
</head>
<body>
  <div class="box box1">1</div>
  <div class="box box2">2</div>
</body>
</html>